<f:view xmlns="http://www.w3.org/1999/xhtml" 
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:w="http://www.apusic.com/jsf/widget" 
		xmlns:layout="http://www.apusic.com/jsf/layout"
		xmlns:ajax="http://www.apusic.com/jsf/ajax"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:om="http://www.apusic.com/jsf/misc"
		xmlns:kd="http://www.kingdee.com/jsf/component"
		renderKitId="AJAX">
			<kd />
	<w:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		 <META   HTTP-EQUIV="Pragma"   CONTENT="no-cache" />   
		 <META   HTTP-EQUIV="Cache-Control"   CONTENT="no-cache" />   
		 <META   HTTP-EQUIV="Expires"   CONTENT="0" />  	
	  <w:script src="/resource/commonQuery.js"/>	
	  <script type="text/javascript" src="#{skin.getResourceURL('/promptBox.js')}"></script>
	  <script type="text/javascript" src="CommonQueryDialog.js"></script>
		<w:stylesheet src="/resource/common.css"/>
	  <link rel="stylesheet" type="text/css" href="#{skin.getSkinReourceURL('/widget/css/kdctrl.css')}"/>
		<style type="text/css">
		    .listSolution{float:left;width:155px;height:100%} 
		    .commonFilter{float:right;margin:0px;border:0px;}
        .content {
	          width:155px;
	          height:100%;
	          POSITION: absolute;
	          overflow-x:auto;
         }
         
         .spanSel{background:Highlight;	color:white;CURSOR: hand;}
         
         .spanCss {
	          float:left;
	          padding-left:2px;
	          width:100%;	
	          height:20px;
         }
		</style>
	</w:head>
	<w:page title="#{winlet.CommonQueryDialogNoSolutionBean.title}" loadMask="true" prependId="false" styleClass="x-form">
	     
			<ajax:scripter script="#{winlet.CommonQueryDialogNoSolutionBean.actionScript}"></ajax:scripter>	

			
			<w:form style="margin:0px" id="queryDialog" onsuccess="ajaxSubmitOK();">
		    	 
		    	 <div class='commonFilter'>
			      <div  id='listContainer'>
        		<ajax:updater binding="#{winlet.CommonQueryDialogNoSolutionBean.hiddenComboUpdater}">
				
		   			</ajax:updater>
		   	 	    
            </div>
              
		    		  <layout:tabLayout jsvar='filterTabs' title="center" style="width:650px;height:379px;">	
		    		    <layout:columnLayout jsvar='filterTab1'  border="false" title="条件">					
		    		       <layout:panel style="border:0px" columnWidth="1." header="false" height="379">
		    		         <ajax:updater id="userFilterPanel" binding="#{winlet.CommonQueryDialogNoSolutionBean.userPanel}"></ajax:updater>
		    		       </layout:panel>  
		    		    </layout:columnLayout>
							  <layout:columnLayout jsvar='filterTab2' border="false" title="自定义">
					        <layout:panel style="border:0px" columnWidth="1." header="false" height="379">
					            <w:editDataGrid id="filterGrid" height="322" style="height:150px;"
					                  jsvar='filterGrid'
       											trackMouseOver="false" 
	        									toolBarPosition="top"
	        									var="data"
	        									paged="true"
	        									value="#{FilterGridDataModel.conditionList}">
      								<w:pagingToolbar>
	    								    <w:separator/>
		  								    <w:button value="增加" action="#{winlet.CommonQueryDialogNoSolutionBean.addRow}"/>
          								<w:button value="删除" action="#{winlet.CommonQueryDialogNoSolutionBean.removeRow}"/>
          								<w:button value="清除" action="#{winlet.CommonQueryDialogNoSolutionBean.removeAll}"/>  
      								</w:pagingToolbar>	
      								    <w:idColumn id="id" header="ID" hidden="true" value="#{data.id}"/>        									
									    <w:outputColumn id="leftBracket" header="左括号" width="50" value="#{data.leftBracket}" editor="leftBracketEditor">
      									<w:combo id="leftBracketEditor" forceSelection="false" allowBlank="true">
      									  <f:selectItems id="leftBRItems" value="#{FilterGridDataModel.leftBracketItems}"/>
      								  </w:combo>
      								</w:outputColumn>
      								<w:outputColumn id="filterField" header="过滤条件" width="120" value="#{data.filterField}" editor="filterFieldEditor">
      								  <w:combo id="filterFieldEditor" forceSelection="false" allowBlank="true" editable="false"  maxHeight="200">
      									  <f:selectItems id="filterFieldItems" value="#{FilterGridDataModel.filterFieldItems}"/>
      								  </w:combo>
      								</w:outputColumn>
      								<w:outputColumn id="compareOp" header="比较符" width="50"  value="#{data.compareOp}"  editor="compareOpEditor" requireEscape="false" editorSelector="window.mycompareSelector">
      								  <w:combo id="compareOpEditor"  jsvar="compareOpEditor" forceSelection="false" allowBlank="true" editable="false">
      									  <f:selectItems id="compOpItems" value="#{FilterGridDataModel.compareOpItems}"/>
      								  </w:combo> 
      								</w:outputColumn>
      								<w:outputColumn id="filterValue" header="比较值" width="80"  value="#{data.filterValue}"   clientFormatter="formatField" editorSelector="window.myEditorSelector">
      								  <w:textField id="textFieldEditor" jsvar="textFieldEditor" allowBlank="true" emptyText=""/>
      								  <w:combo id="comboFieldEditor" jsvar="comboFieldEditor" maxHeight="200">
										 <f:selectItems id="filterValueItems" value="#{winlet.CommonQueryDialogNoSolutionBean.contiditonItem}"/>
									  </w:combo>
									  <kd:promptBox id="F7FieldEditor" jsvar="F7FieldEditor" diaplayFormat="$number$-$name$"
									           queryInfo="com.kingdee.eas.cp.bc.app.F7ExpenseTypeQuery"/>
      								  <w:dateField  id="dateFieldEditor" format="yyyy-MM-dd" jsvar="dateFieldEditor" >
											<f:convertDateTime pattern="yyyy-MM-dd" />
									  </w:dateField>
      								</w:outputColumn>
      								<w:outputColumn id="rightBracket" header="右括号" width="50"  value="#{data.rightBracket}"  editor="rightBracketEditor">
      								  <w:combo id="rightBracketEditor" forceSelection="false" allowBlank="true">
      									  <f:selectItems id="rightBRItems" value="#{FilterGridDataModel.rightBracketItems}"/>
      								  </w:combo>
      								</w:outputColumn>
      								<w:outputColumn id="logicalOp" header="逻辑符" width="50"  value="#{data.logicalOp}"   editor="logicalOpEditor">
        								<w:combo id="logicalOpEditor" forceSelection="false" allowBlank="true">
      									  <f:selectItems id="logOpItems" value="#{FilterGridDataModel.logicalOpItems}"/>
      								  </w:combo>    								
      								</w:outputColumn>  										
    							  </w:editDataGrid> 
					        </layout:panel>
					      </layout:columnLayout>			
					    </layout:tabLayout>
				    </div>	   
				
                <table style="float:left;width:97%;margin:5px">
                	<tr>
                    	<td style="width:50px"/>
                    	<td style="width:440px; color: #FF0000">
                    		<h:outputText id="msgArea" value="#{winlet.CommonQueryDialogNoSolutionBean.tipMessage}" style="width: 240px; color: #FF0000; text-align: center"/>
                    	</td>
                    	<td style="width:36px"/>
                    	<td>
      						      <w:button id="btnOK" value="确定" align="right" action="#{winlet.CommonQueryDialogNoSolutionBean.doOK}"/>
      					      </td>
      					      <td>
        					       <w:button id="btnCancel" value="取消"  align="right" onclick="KD.commonQuery.doClose();return false;"/>
        				      </td>
        			     </tr>
                </table>  
         <div style="display:none" >        
                <w:combo jsvar="hiddenCombo" id = "hiddenCombo" style="display:none;width:0px;height:0px" triggerClass="hiddenCls">
						<f:selectItems value="#{winlet.CommonQueryDialogNoSolutionBean.hiddenComboValues}"/>
		    	</w:combo>  
		    </div>
  	     </w:form>
  	
  
		  <layout:window id="solutionNameDialog"  binding="#{winlet.CommonQueryDialogNoSolutionBean.solutionNameDialog}" 
    			  width="300" 
    			  height="150" 
    			  modal="true" 
    			  collapsible="false"
    			  resizable="false" 
    			  title="方案保存">  
    			 <ajax:updater id="solutionUpdate" binding="#{winlet.CommonQueryDialogNoSolutionBean.solutionUpdate}"></ajax:updater>	
		  </layout:window> 
	</w:page> 
	
	<script type="text/javascript">
		//<![CDATA[	
			 Ext.onReady(function(){
			     window.init=function(){
			       var msg=document.getElementById('queryDialog:msgArea');
			       if (msg){
			         msg.innerText='';
			       }
			     }
			     if(filterGrid){
			        filterGrid.on('afteredit',function(e){
				    if(e.field == 'filterField' && e.originalValue!=e.value){
					 e.record.set('filterValue','');
				  }
			    });
			        }
			
			     filterGrid.on("cellclick", filterGrid.onCellDblClick, filterGrid);
			     //syncSolutionList();
			     if (window.pageOnLoad)window.pageOnLoad();
			 	   #{winlet.CommonQueryDialogNoSolutionBean.onLoadScript}
				  
			  });
			  
		//]]>
	</script>		
</f:view> 